Field of the Invention
The field of the invention relates to data processing and in particular to diagnostic mechanisms for monitoring data processing operations.
Description of the Prior Art
There are a number of situations where it is desirable to keep track of the processing being performed by a processing circuit. For example, such information is useful during the development of data processing systems. An example of a tool that may be used to assist in such a process is a tracing tool.
Tracing the activity of a data processing system whereby a trace stream is generated that includes data representing the step-by-step activity within the system is a highly useful tool in system development. Such tracing tools use a variety of means for tracing the program flow including embedded trace macrocells (ETM, a trademark of ARM Limited, Cambridge) which are present on the chip whose processing is being monitored.
If the complete step by step activity of a processing system is monitored the amount of data that needs to be collected, transmitted and stored can be prohibitively large. Thus, various ways of reducing this amount of information have been devised. These include reducing the amount of trace data generated by only tracing some instructions such as branches and load/store instructions, all other “trace-inactive” instructions being inferred from the trace of these “trace-active” instructions and a knowledge of the instruction stream. Further reduction in the trace stream is possible by providing the ability to turn the trace on and off, so that for certain parts of the execution that are deemed trace-inactive no trace data is generated. This ability to only trace a subset of instructions is described in U.S. Pat. No. 7,707,394.
Most processor instruction set architectures include the ability to execute instructions speculatively in order to increase processing speed. Thus, for example, branch instructions that are conditional on the state of the data processing system at the point where the branch is processed, and will execute and branch to the destination if some condition is true, and not execute and continue to the next sequential instruction if the condition is false, may be predicted as executing in a certain way, so that the subsequent instructions can be executed before it is known whether the condition is true or false. If the prediction is wrong then the speculatively executed instructions will need to be cancelled and the processor restored to the state it had before the branch was taken.
It is not always straightforward when tracing speculatively executed instructions to keep the trace stream output consistent with the instructions that are actually committed.